Electronic products, such as laptop computers, tablet computers, smartphones, cellular phones, multimedia players, handheld gaming devices, and other devices, and software applications that run on them, typically use large numbers of bitmap images for displaying user interface (UI) icons, logos, symbols, images and other graphics. If a device is configured to support bitmap images at a variety of sizes or across a spectrum of device resolutions, then the bitmaps generally must be created and stored for each of the target sizes and device resolutions. For example, vector images of desired graphics are typically created and hand-tuned separately for each targeted resolution using a bitmap editing tool. In the Android graphics environment, hand-tuned bitmaps are typically created for every icon, every background (especially if non-rectangular, bordered, shaded, or textured), every button shape, and so forth at low density resolution (LDPI), medium density resolution (MDPI), high density resolution (HDPI), and extra high density resolution (XHDPI). Many of these icons are relatively simple shapes, having a handful of contours which would be under several hundred bytes when represented as vector-graphic objects, but their bitmap representations are several thousand bytes. As a result, use of multiple resolution-specific bitmaps for each graphic poses asset management issues in the display/production environment and storage issues on the device.
A more efficient use of device memory and processing resources could be achieved by creating and storing icons or other graphics as vector graphics and scaling them to the target resolution. However, conventional vector graphics scaling techniques often produce undesirable quality, especially where the scaling is between resolutions that do not have an integer relationship. As a result, many icons are initially created using a vector graphics design tool and are then manually converted to resolution-specific bitmaps and hand-tuned to achieve a desired quality for a target screen resolution.
To illustrate errors typically introduced through conventional vector graphics scaling, reference is made to FIG. 1, which illustrates non-integer, high-to-low resolution scaling of an exemplary graphic 101 in accordance with conventional graphics scaling techniques. More particularly, FIG. 1 illustrates conventional scaling between screen resolutions having a ratio of 1.33:1, such as would be the case when scaling from MDPI to LDPI or from XHDPI to HDPI. In such a case, the pixel grid of the target resolution does not align with the pixel grid of the source resolution.
As can be observed from FIG. 1, the exemplary graphic 101 includes a generally rectangular border 103 surrounding five progressive-height, common-width, equally-spaced bars 105-109. The exemplary graphic 101 may be used to visually indicate received signal strength for a wireless network to which the electronic device is connected. After scaling the graphic 101 according to conventional techniques, the scaled graphic 111 is distorted relative to the original graphic 101. For example, the rectangular border 113 of the scaled graphic 111 does not maintain the same thickness in proportion to the widths of the bars 115-119 of the scaled graphic 111. Additionally, the bars 115-119 of the scaled graphic 111 no longer have the same widths or equal spacing. As a result, while the scaled graphic 111 has the same general arrangement as the original graphic 101, the quality of the scaled graphic 111 is significantly degraded.
In the early 1990's, font developers recognized that additional processing was needed to display fonts on electronic displays and the 240-300 dots per inch (dpi) printers of that era. So, the developers created a specialized service, referred to as “font hinting,” to improve the quality of fonts as displayed on the various displays and printers. According to font hinting, critical features and control points of font glyph contours are identified and pixel-grid-related positioning adjustments are made to the features and/or control points to improve the appearance of the contours when imaged or displayed on a target pixel grid. For example, positions of the control points of a font glyph are adjusted so that the font glyph is ideally registered to (aligned with) the pixel grid of the target display or printer. The pixel-grid adjustments are defined by constraints or rules applied to individual control points, sets of control points, and/or the relationships (e.g., distances) between two or more control points of a font glyph. The features, control points, and constraints for font glyphs of a particular font are embedded in the font formats and font engine for the font.
While font hinting provides high quality display scalability for fonts, it is insufficient for general graphics containing. Importantly, font hinting does not address shadows of multiple shapes/objects or relations of objects to one another (such as abutting or co-aligned portions of adjacent contours as opposed to relationships purely between control points within a single object as occurs in a font glyph). Additionally, font hinting does not address uniformity/progressions of spacing between two or more objects. Spatial relationships between font glyphs, such as in a displayed sentence, are handled by separate processes, such as kerning and justification, outside of the font format itself. Additionally, font hinting has been generally ignored by the graphics community, which maintains a belief that adjusting the outline of an object is unnecessary. Instead, the graphics industry relies upon anti-aliasing, gamma curve adjustments, and dithering to address scaling-related issues. Furthermore, because graphic authoring tools do not typically support intelligent scaling, graphic designers have not considered the algorithmic scaling of vector graphics to be adequate and, therefore, have deferred to creating individual bitmaps at targeted display resolutions.
Skilled artisans will appreciate that elements in the figures are illustrated for simplicity and clarity and have not necessarily been drawn to scale. For example, the dimensions of some of the elements in the figures may be exaggerated alone or relative to other elements to help improve the understanding of the various exemplary embodiments of the present invention.